package ma.cdm.compteRendu.bo;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * PersonneExterne entity. @author Limouri Anouar
 */
@Entity
@Table(name="personneexterne")

public class PersonneExterne  implements java.io.Serializable {

	// Fields

	private Long idpersonneexterne;
	private String nom;
	private String prenom;
	private String civilite;
	private String mail;
	private String telephone;
	private String fonction;
	private String societe;
	private Set<ParticipantExterne> participantexternes = new HashSet<ParticipantExterne>(
			0);

	// Constructors

	/** default constructor */
	public PersonneExterne() {
	}

	/** full constructor */
	public PersonneExterne(String nom, String prenom, String civilite,
			String mail, String telephone, String fonction, String societe,
			Set<ParticipantExterne> participantexternes) {
		this.nom = nom;
		this.prenom = prenom;
		this.civilite = civilite;
		this.mail = mail;
		this.telephone = telephone;
		this.fonction = fonction;
		this.societe = societe;
		this.participantexternes = participantexternes;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "IDPERSONNEEXTERNE", unique = true, nullable = false)
	public Long getIdpersonneexterne() {
		return this.idpersonneexterne;
	}

	public void setIdpersonneexterne(Long idpersonneexterne) {
		this.idpersonneexterne = idpersonneexterne;
	}

	@Column(name = "NOM", length = 100)
	public String getNom() {
		return this.nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	@Column(name = "PRENOM", length = 100)
	public String getPrenom() {
		return this.prenom;
	}

	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}

	@Column(name = "CIVILITE", length = 5)
	public String getCivilite() {
		return this.civilite;
	}

	public void setCivilite(String civilite) {
		this.civilite = civilite;
	}

	@Column(name = "MAIL", length = 100)
	public String getMail() {
		return this.mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	@Column(name = "TELEPHONE", length = 60)
	public String getTelephone() {
		return this.telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	@Column(name = "FONCTION", length = 100)
	public String getFonction() {
		return this.fonction;
	}

	public void setFonction(String fonction) {
		this.fonction = fonction;
	}

	@Column(name = "SOCIETE", length = 100)
	public String getSociete() {
		return this.societe;
	}

	public void setSociete(String societe) {
		this.societe = societe;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "personneExterne")
	public Set<ParticipantExterne> getParticipantexternes() {
		return this.participantexternes;
	}

	public void setParticipantexternes(
			Set<ParticipantExterne> participantexternes) {
		this.participantexternes = participantexternes;
	}

}